#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main()
{
    freopen("candy.in","r",stdin);
    freopen("candy.out","w",stdout);
    int n,l,r;
    cin>>n>>l>>r;
    int t=n*int(ceil(l/n))+n-1;
    if(t>r)
        cout<<r-n*int(ceil(l/n));
    else
        cout<<n-1;
}